<?php
namespace app\index\model;

use think\Model;

class Bbs extends Model 
{
 

    public static function show($list_rows = '10'){

    	$list = Bbs::where('status',1)
            ->order('id', 'desc')
            ->paginate($list_rows);
            return $list;
    }
    public static function view($id = '1'){

        // 取出主键为1的数据
        $view = Bbs::get($id);
        return $view;
    }

    public static function add($title,$content){

 

            $user             = new Bbs;
            $user->title      = $title;
            $user->content    = $content;
            $user->save();


   
        
            return  $user->id;


        


    }

}